﻿Public Class CreatePromitheutesUserControl

    Private Sub PromitheytesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.PromitheytesBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.Hard_oneDataSet)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Pistotikos_elegxosCheckBox.Checked Then

            Me.PromitheytesTableAdapter.InsertQuery(IdPromitheytiTextBox.Text, OnomaTextBox.Text, EpithetoTextBox.Text, EponimiaTextBox.Text, _
         EpaggelmaTextBox.Text, PoliTextBox.Text, DiefthinsiTextBox.Text, Convert.ToInt32(Post_codeTextBox.Text), PhoneTextBox.Text, AfmTextBox.Text, Tropos_pliromisTextBox.Text, _
         CheckState.Checked, Convert.ToInt32(PistotikoTextBox.Text), Convert.ToInt32(EkptosiTextBox.Text), Im_kataxorisiDateTimePicker.Value.Date, Im_metavolisDateTimePicker.Value.Date, _
         Epixeirisi_idEpixeirisiTextBox.Text, Convert.ToInt32(DoyTextBox.Text))

        Else

            Me.PromitheytesTableAdapter.InsertQuery(IdPromitheytiTextBox.Text, OnomaTextBox.Text, EpithetoTextBox.Text, EponimiaTextBox.Text, _
         EpaggelmaTextBox.Text, PoliTextBox.Text, DiefthinsiTextBox.Text, Convert.ToInt32(Post_codeTextBox.Text), PhoneTextBox.Text, AfmTextBox.Text, Tropos_pliromisTextBox.Text, _
         CheckState.Unchecked, Convert.ToInt32(PistotikoTextBox.Text), Convert.ToInt32(EkptosiTextBox.Text), Im_kataxorisiDateTimePicker.Value.Date, Im_metavolisDateTimePicker.Value.Date, _
         Epixeirisi_idEpixeirisiTextBox.Text, Convert.ToInt32(DoyTextBox.Text))

        End If
    End Sub
End Class
